package org.jgs1904.test;

/**
 * @author 墨苍璃
 * @date 2023年07月18日12时41分
 * <p>
 * 异常转换
 */
public class Convert {
    public static void main(String[] args) {
        try {
            process1();
        } catch (Exception e) {
            System.out.println("1   " + e.getCause());
            e.printStackTrace();
        }
    }

    static void process1() {
        try {
            process2();
        } catch (NullPointerException e) {
            System.out.println("2   " + e.getCause());
            throw new IllegalArgumentException(e);
        }
    }

    static void process2() {
        throw new NullPointerException();
    }
}
